$(".man-col").mouseenter(function () {
    $(".man-list").stop(true)
    $(".man-list").animate({
        height: 'show'
    }, 200)
});
$(".man-col").mouseleave(function () {
    $(".man-list").stop(true)
    $(".man-list").animate({
        height: 'hide'
    }, 200)
});
$(".woman-col").mouseenter(function () {
    $(".woman-list").stop(true)
    $(".woman-list").animate({
        height: 'show'
    }, 200)
});
$(".woman-col").mouseleave(function () {
    $(".woman-list").stop(true)
    $(".woman-list").animate({
        height: 'hide'
    }, 200)
});
$(".parts").mouseenter(function () {
    $(".parts-list").stop(true)
    $(".parts-list").animate({
        height: 'show'
    }, 200)
});
$(".parts").mouseleave(function () {
    $(".parts-list").stop(true)
    $(".parts-list").animate({
        height: 'hide'
    }, 200)
});

// 轮播图1
var mySwiper1 = new Swiper('#container1', {
    // 开启自动轮播
    autoplay: true,
    // 实现点击效果
    navigation: {
        nextEl: '.btn-next1',
        prevEl: '.btn-prev1',
    },
    loop: true,
})

// 吸顶菜单
window.onscroll = function () {
    var scroollTop = document.documentElement.scrollTop || document.body.scrollTop;
    if (scroollTop >60) {
       $(".header_con").css({'position':'fixed','top':'0','z-index':'99'}),
       $(".img_logo>img").css({'width':'70','height':'38'})
    } else {
    $(".header_con").css({'position':'relative'}),
    $(".img_logo>img").css({'width':'170','height':'94'})
}
}

// 轮播图2
var mySwiper2 = new Swiper('#container2', {
      slidesPerView: 4,
	  watchSlidesProgress : true,
	  on: {
	    setTranslate: function(){
			slides = this.slides
			for(i=0; i< slides.length; i++){
				slide = slides.eq(i)
				progress = slides[i].progress
				//slide.html(progress.toFixed(2)); 看清楚progress是怎么变化的
				    slide.css({'opacity': '','background': ''});slide.transform('');//清除样式
					
				}	
		},
		setTransition: function(transition) {
			for (var i = 0; i < this.slides.length; i++) {
				var slide = this.slides.eq(i)
				slide.transition(transition);
			}
		},
	  },
	  navigation: {
            nextEl: '.btn-next2',
            prevEl: '.btn-prev2',
        },
  });

//   锚点
// 因为页面卷动在吸顶菜单上写过，所以不用再次声明
// 回到顶部;
// 1. 点击回到顶部按钮;
// 2. 设置scrollTop 为0;
$(".fa-angle-up").click(function(){
    document.documentElement.scrollTop = 0;
    document.body.scrollTop = 0;
})


// 判断是否有用户 cookie 数据
$(document).ready(function () {
    // document.cookie.indexOf('usermsg=') === 0
    if ($.cookie('usermsg') !== undefined) {
        $('.sign').hide();
        $('.msg').show();
        $('.msg').html($.cookie('usermsg'));
    } else {
        $('.sign').show();
        $('.msg').hide();
    }
})







